package com.lbfamous.strings;

import java.io.*;
import java.util.regex.*;
import java.util.List;



public class CSVRE implements CSVParser {
    
    public static final String CSV_PATTERN = "\" ([^\"]+?) \",?| ([^, ]+) , ?|, ";
    private static final Pattern csvRE = Pattern.compile(CSV_PATTERN);

    public static void main(String[] args) throws IOException
    {
        System.out.println(CSV_PATTERN);
        new CSVRE().process(new BufferedReader(new InputStreamReader(System.in)));
    }

    public void process(final BufferedReader input) throws IOException {
        String line;
        while((line = input.readLine()) != null){
            System.out.println("line =' "+ line + "'");
            final List<String> list = parse(line);
            System.out.println("Found "+ list.size() + " items.");
            for(String str:list){
                System.out.println(str + " ");
            }
            System.out.println();
        }
    }

    public List<String> parse(final String line){

        return null;
    }
}